package com.anti_poverty_detection_system.springboot.service.impl;

import com.anti_poverty_detection_system.springboot.mapper.UsersMapper;
import com.anti_poverty_detection_system.springboot.model.Households;
import com.anti_poverty_detection_system.springboot.mapper.HouseholdsMapper;
import com.anti_poverty_detection_system.springboot.model.Users;
import com.anti_poverty_detection_system.springboot.service.IHouseholdsService;
import com.anti_poverty_detection_system.springboot.service.dto.HouseholdAndUserRequest;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ZITONG BAI
 * @since 2024-06-17
 */
@Service
public class HouseholdsServiceImpl extends ServiceImpl<HouseholdsMapper, Households> implements IHouseholdsService {

    @Autowired
    HouseholdsMapper householdsMapper;
    @Autowired
    UsersMapper usersMapper;
    public Households getHouseholdsByUsers(Integer user_id){
        QueryWrapper<Households> queryWrapper=new QueryWrapper<>();
        queryWrapper.eq("user_id",user_id);
        return householdsMapper.selectOne(queryWrapper);
    }

}
